import request from './request';

// 文章/评论数据
export function GetArticle(params) {
  return request({
    url: 'articles',
    params
  });
}

// 频道数据
export function GetChannel() {
  return request({
    url: 'channels'
  })
}

// 删除文章
export function GetDelectArticle(articleId) {
  return request({
    method: 'DELETE',
    url: `articles/${articleId}`
  })
}

// 修改评论状态
export function UpdataCommentStatus(articleId, allowComment) {
  return request({
    url: 'comments/status',
    method: "PUT",
    params: {
      article_id: articleId
    },
    data: {
      allow_comment: allowComment
    }
  });
}